Skip to content

fix(server): Antigravity 1.5 quota errors resume at the reset - #39196

Open
OmarAlex24 wants to merge 1 commit into
pingdotgg:mainfrom
OmarAlex24:t3/antigravity-json-quota-usage-limit
Open

OmarAlex24 wants to merge 1 commit into
pingdotgg:mainfrom
OmarAlex24:t3/antigravity-json-quota-usage-limit

Conversation

@OmarAlex24

Copy link
Copy Markdown
Contributor

Problem

When an Antigravity 1.5 turn hits its individual quota, the thread shows "Provider error: Antigravity stopped this turn because of an error." instead of "Usage limit reached". Because the failure is not usage_limit and has no resetAt, usage-limit recovery never arms and the thread is not resumed when the quota resets.

#28629 and #29594 handle the 1.4.x error step, which renders Google's error as a Go map (Error 429, Message: …, Status: RESOURCE_EXHAUSTED, Details: [map[… reason:QUOTA_EXHAUSTED]]). Runtime 1.5.12 writes the same error step in a different shape: RESOURCE_EXHAUSTED (code 429): Individual quota reached. … Resets in 2h24m51s., then protobuf bytes, then Google's JSON body ("reason": "QUOTA_EXHAUSTED", "quotaResetTimeStamp": "2026-11-19T18:33:55Z"). None of the AntigravityTurnOutcome patterns match it, so turnFailure falls through to the generic provider error.

Fix

In AntigravityTurnOutcome.ts:

  • QUOTA_EXHAUSTED, RESET_TIMESTAMP, RESET_DELAY and RETRY_DELAY accept both the Go map's key:value and JSON's "key": "value". The timestamp capture stops at " and ,, so the JSON timestamp parses. Without that it would silently fall back to the delay.
  • A new STATUS_ERROR pattern reads the STATUS (code NNN): message header. It is a fallback for API_ERROR, and its groups keep API_ERROR's order, so turnFailure changes by one line. The message capture stops at the first control character, where the protobuf bytes start.

How I found it and checked it

I found it in daily use: an Antigravity thread on gemini-4-neon-xhigh ran out of quota and showed the provider-error card with no option to continue at reset. The session log's last step (type 17) contained the payload described above.

  • Red on main: the new row in AntigravityTurnOutcome.test.ts (trimmed from the real step, with the trace ID, headers and session ids removed) fails with class: "provider_error", message: "Antigravity stopped this turn because of an error.", which is exactly what the thread showed. With the fix it returns usage_limit with resetAt: "2026-11-19T18:33:55.000Z". The test runs on TestClock, so a delay fallback would produce a 1970 timestamp; this result shows the JSON timestamp itself is parsed.
  • The existing 1.4.x Go-map rows (quota, rate limit with retryDelay, invalid argument, thinking signature) still pass unchanged.
  • Replayed the real session log: I copied it to a temp profile and trimmed it to before the error step, started watchAntigravityPromptOutcome, appended the real error step, and ran the check. main returns provider_error with no resetAt. This branch returns { class: "usage_limit", code: "RESOURCE_EXHAUSTED", retryable: true, resetAt: "2026-11-19T18:33:55.000Z" }.
  • vp run check:changed passes (format, lint, knip, typecheck, tests).

I have only observed the QUOTA_EXHAUSTED case in the 1.5 format. A plain 429 rate limit in that format now also takes the existing rate-limit branch through STATUS_ERROR, but I have not seen one live.

Overlap: #33596 (open) rewrites the API_ERROR line for 502s, and #39123 (open) adds an empty-output branch. This PR leaves API_ERROR untouched and only adds a fallback next to it, so either one rebases trivially.

Written with Claude Opus 5.5 in Claude Code, running inside T3 Code.

🤖 Generated with Claude Code

Antigravity 1.5 writes the upstream error as "STATUS (code NNN): message"
followed by Google's JSON body, so the Go-map patterns missed the quota
reason and reset time. The turn failed as a plain provider error and
usage-limit recovery never armed. The patterns now accept both spellings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 19, 2026
@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Antigravity turn failure parsing now recognizes 1.5-style status errors and JSON-formatted quota and retry metadata. A new test checks the parsed usage-limit failure, retryability, error code, and quota reset time.

Changes: Antigravity quota error handling

Layer / File(s) Summary
Parse and verify quota errors
apps/server/src/provider/acp/AntigravityTurnOutcome.ts, apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
The parser recognizes 1.5-style status errors and JSON-formatted quota and retry metadata. The test checks a retryable usage_limit failure with code RESOURCE_EXHAUSTED and a timestamp-derived resetAt.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: t3dotgg, saphid

Merge Risk: Minimal · up to fd673

Antigravity 1.5 quota errors are now recognized as usage-limit failures with a reset time. The change is small and tested, and no merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: Antigravity 1.5 quota errors are fixed so threads resume at the reset time. It matches the changeset, which adds JSON-format quota/reset parsing and a STATUS_ERROR …
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the failing behavior and the cause. The Change section explains the pattern up…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the primary change: Antigravity 1.5 quota errors are fixed so threads resume at the reset time. It matches the changeset, which adds JSON-format quota/reset parsing and a STATUS_ERROR fallback in AntigravityTurnOutcome.ts. It follows the conventional commit style used in the repository template.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the failing behavior and the cause. The Change section explains the pattern updates and the STATUS_ERROR fallback. The Scope section links related PRs (#28629, #29594, #33596, #39123) but does not link a specific issue that shows the bug. It also states that the bug was found in daily use, and it does not explain why no issue exists. The Verification section gives focused tests, a replay of the real session log, and the observed results, and it states what was not checked (plain 429 in 1.5 format). The template asks for a linked issue or a reason for none, so the Scope section is incomplete, but the rest is thorough. The model and harness are named at the end, as the template requests.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b5be2ff and fd673b7.

Files selected for processing: 2

  • apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts
  • apps/server/src/provider/acp/AntigravityTurnOutcome.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

iwatakeshi added a commit to iwatakeshi/t3code that referenced this pull request Nov 19, 2026
Adapt quota credential support from upstream PR pingdotgg#36733, native quota errors from pingdotgg#39196, and watchdog diagnostics from pingdotgg#33596. Native CLI instances ignore stale legacy credentials; packaged servers load keyring bindings through require. Preserve the captured NOT_FOUND 404 message without enabling automatic retries.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant